//
//  ZWLTabbarController.swift
//  QY-Swift
//
//  Created by tsc-zwl on 16/4/15.
//  Copyright © 2016年 tsc-zwl. All rights reserved.
//

import UIKit

class ZWLTabbarController: UITabBarController {

    override func viewDidLoad() {
        super.viewDidLoad()

        addChildViewControllers()
    }
    
    /// 添加所有子控制器
    fileprivate func addChildViewControllers() {

        tabBar.tintColor = UIColor.orange
        addChildViewController(ZWLHomeViewController(), title: "首页", imageName: "btn_home")
        addChildViewController(UIViewController(), title: "直播", imageName: "btn_column")
        addChildViewController(UIViewController(), title: "关注", imageName: "btn_live")
        addChildViewController(UIViewController(), title: "我的", imageName: "btn_user")
    }
    

    fileprivate func addChildViewController(_ vc: UIViewController, title: String, imageName: String) {
        vc.tabBarItem.title = title
        vc.tabBarItem.image = UIImage(named: imageName)
        vc.tabBarItem.selectedImage = UIImage(named: "\(imageName)_selected")
        let nav = ZWLNavController(rootViewController: vc)
        
        addChildViewController(nav)
    }


}
